home *** CD-ROM | disk | FTP | other *** search
/ Internet.Works 40 / Issue 40.iso / pc / PCSoftware / HTML Tool 3.5 / htmltool.exe / _SETUP.1 / Dynamic links.scp < prev    next >
Encoding:
Text File  |  2000-03-06  |  1000 b   |  38 lines

  1. <HTMLtool>A combobox with various links</HTMLtool>
  2.  
  3. <!-- ONE STEP TO INSTALL DYNAMIC LINKS:
  4.  
  5.   1.  Copy the coding into the BODY of your HTML document  -->
  6.  
  7. <!-- STEP ONE: Paste this code into the BODY of your HTML document  -->
  8.  
  9. <center>
  10. <form name="addresses">
  11. do you want to ... <select name="list" onChange="update()">
  12. <option value="mailto:admin@some-site.com">email admin@some-site.com
  13. <option value="mailto:support@some-site.com">email support@some-site.com
  14. <option value="http://www.netscape.com">go to www.netscape.com
  15. </select> 
  16. <a href="updatelink">do it!</a>
  17. </form>
  18. </center>
  19.  
  20. <script language="javascript">
  21.  
  22. <!--  begin
  23. pos = 9999;
  24. for(num=0;num<document.links.length;num++) {
  25. if (document.links[num].href.indexOf("updatelink") != -1) {
  26. pos = num;
  27. num = 5000;
  28.    }
  29. }
  30. function update() {
  31. if (pos!=9999) {
  32. sel = document.addresses.list.selectedIndex;
  33. document.links[pos].href = document.addresses.list[sel].value;
  34.    }
  35. }
  36. update();
  37. // end -->
  38. </script>